﻿using System;
using System.Net;
using System.Windows;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BlueRoseGames.Controls.Text
{
    public static class FontManager
    {
        public static Dictionary<string, Font> Fonts = new Dictionary<string, Font>();

        public async static Task<Font> GetFont(string fontFamily)
        {
            if (Fonts.ContainsKey(fontFamily))
            {
                return Fonts[fontFamily];
            }
            else
            {
                Font f = new Font();
                await f.Initialize(fontFamily);
                Fonts.Add(fontFamily, f);
                return f;
            }
        }
    }
}
